import QtQuick 2.6
import QtQuick.Layouts 1.2

import "../Base/UiBase"
import "../Base/Config"

import Data 1.0

import Cpp.Type 1.0

SvgzImage {
    width: width
    height: height
    source: "../../resources/tests/335X335.jpg"
    Column {
        anchors.fill: parent
        spacing: 0
        Item {
            width: parent.width
            height: 30 * Size.ratio
        }
        Item {
            width: parent.width
            height: 150 * Size.ratio
            HeadHolder {
                anchors.centerIn: parent
                SvgzImage {
                    width: 150 * Size.ratio
                    height: 150 * Size.ratio
                    source: "../../resources/tests/335X335.jpg"
                    SvgzImage {
                        width: 150 * Size.ratio
                        height: 150 * Size.ratio
                        source: "../../resources/personal/baiquan.svg"
                    }
                }
            }
        }

        Item {
            width: parent.width
            height: 10 * Size.ratio
        }
        Item {
            width: parent.width
            height: 40 * Size.ratio
            Text {
                anchors.centerIn: parent
                text : User.name
                color: Color.foreground
                font.pixelSize: Size.font32
                SvgzImage {
                    anchors.verticalCenter: parent.verticalCenter
                    anchors.left: parent.right
                    width: 30 * Size.ratio
                    height: 30 * Size.ratio
                    source: User.sex ? "../../resources/personal/nvsheng.svg" : "../../resources/personal/nansheng.svg"
                }
            }
        }
        Item {
            width: parent.width
            height: 30 * Size.ratio
        }
        RowLayout {
            width: parent.width
            height: 30 * Size.ratio
            Item {
                Layout.fillWidth: true
                Layout.fillHeight: true
                Text {
                    anchors.centerIn: parent
                    color: Color.foreground
                    font.pixelSize: Size.font26
                    text: User.province + " " + User.city
                }
            }
            Item {
                Layout.fillWidth: true
                Layout.fillHeight: true
                Text {
                    anchors.centerIn: parent
                    color: Color.foreground
                    font.pixelSize: Size.font26
                    text: User.level
                }
            }
            Item {
                Layout.fillWidth: true
                Layout.fillHeight: true
                Text {
                    anchors.centerIn: parent
                    function trSubject(subject)
                    {
                        if(subject === Subject.Music)
                            return qsTr("音乐生")
                        if(subject === Subject.Pe)
                            return qsTr("体育生")
                        return qsTr("美术生")
                    }
                    color: Color.foreground
                    font.pixelSize: Size.font26
                    text: trSubject(User.subject)
                }
            }
        }
    }
}
